       IDENTIFICATION DIVISION.
       PROGRAM-ID. ZONEDISTRICT.
       ENVIRONMENT DIVISION.
	   CONFIGURATION SECTION.
	   SOURCE-COMPUTER.
	   OBJECT-COMPUTER.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  SALEREC.
	  02 ZONE  OCCURS 4 TIMES.
	   03 DISTRICT OCCURS 8 TIMES.
	    04 MONTH OCCURS  12 TIMES.
	      05 AMOUNT  PIC 9(4).
       77 C      PIC X.
       77 CH     PIC 9    VALUE IS 0.
       77 I      PIC 9    VALUE IS 0.
       77 J      PIC 9    VALUE IS 0.
       77 K      PIC 99   VALUE IS 0.
       77 TEMP   PIC Z(4).
       77 TOTAL  PIC 9(6) VALUE IS 0.
       77 TEMP1  PIC Z(6).

       PROCEDURE DIVISION.
       MAINPARA.
	   IF CH NOT = 5 GO TO MENU.
	   STOP RUN.
       MENU.
	   DISPLAY (1, 1) ERASE.
	   DISPLAY "-------MENU-------".
	   DISPLAY " 1 . . .ADD DATA     ".
	   DISPLAY " 2 . . .REPORT       ".
	   DISPLAY " 3 . . .ZONEWISE     ".
	   DISPLAY " 4 . . .DISTRICTWISE ".
	   DISPLAY " 5 . . .EXIT         ".
	   MOVE 7 TO LIN.
	   MOVE 1 TO COL.
	   DISPLAY (LIN, COL) " CHOICE : ".
	   ACCEPT CH.
	   IF CH = 1 GO TO ADDPARA.
	   IF CH = 2 GO TO OUTPARA.
	   IF CH = 3 GO TO ZONEPARA.
	   IF CH = 4 GO TO DISTPARA.
	   GO TO MAINPARA.
       ADDPARA.
	   PERFORM ADDZONE VARYING I FROM 1 BY 1 UNTIL I > 4.
	   GO TO MENU.
       ADDZONE.
	   DISPLAY (1, 1) ERASE.
	   DISPLAY "                        -------- DATA ENTRY -------".
	   DISPLAY "                                   ZONE ", I.
	   DISPLAY "-------------------------------------------------",
		   "------------------------------".
	   DISPLAY "          JAN   FEB   MAR   APR   MAY   JUN   JUL",
		    "   AUG   SEP   OCT   NOV   DEC".
	   DISPLAY "-------------------------------------------------",
		   "------------------------------".
	   MOVE 5 TO LIN.
	   PERFORM ADDDIST VARYING J FROM 1 BY 1 UNTIL J > 8.

       ADDDIST.
	   ADD 1 TO LIN.
	   DISPLAY "DIST ", J.
	   MOVE 11 TO COL.
	   PERFORM ADDMONTH VARYING K FROM 1 BY 1 UNTIL K > 12.
       ADDMONTH.
	   ACCEPT(LIN, COL) AMOUNT(I, J, K).
	   ADD 6 TO COL.
       OUTPARA.
	   DISPLAY (1, 1) ERASE.
	   DISPLAY "       SALES DETAILS ".
	   DISPLAY " ".
	   MOVE 3 TO LIN.
	   MOVE 1 TO COL.
	   DISPLAY (LIN, COL) " ENTER ZONE NUM (1..4)     : ".
	   ACCEPT I.
	   ADD 1 TO LIN.
	   DISPLAY (LIN, COL) " ENTER DISTRICT NUM (1..8) : ".
	   ACCEPT J.
	   ADD 1 TO LIN.
	   DISPLAY (LIN, COL) " ENTER MONTH (1 THRU 12)   : ".
	   ACCEPT K.
	   MOVE AMOUNT (I, J, K) TO TEMP.
	   DISPLAY " SALES AMOUNT : ", TEMP.
	   ACCEPT C.
	   GO TO MENU.

       ZONEPARA.
	   MOVE 0 TO TOTAL.
	   DISPLAY (1, 1) ERASE.
	   DISPLAY " ZONEWISE SALES DETAILS".
	   MOVE 3 TO LIN.
	   MOVE 1 TO COL.
	   DISPLAY (LIN, COL) " ENTER ZONE NUMBER (1..4) : ".
	   ACCEPT I.
	   PERFORM ADDZ1 VARYING J FROM 1 BY 1 UNTIL J > 8.
	   MOVE TOTAL TO TEMP1.
	   DISPLAY " ".
	   DISPLAY " SALES AMOUNT : ", TEMP1.
	   ACCEPT C.
	   GO TO MENU.
       ADDZ1.
	   PERFORM ADDMNTH1 VARYING K FROM 1 BY 1 UNTIL K > 12.
       ADDMNTH1.
	   ADD AMOUNT(I, J, K) TO TOTAL.

       DISTPARA.
	   MOVE 0 TO TOTAL.
	   DISPLAY (1, 1) ERASE.
	   DISPLAY " DISTRICTWISE SALES DETAILS: ".
	   MOVE 3 TO LIN.
	   MOVE 1 TO COL.
	   DISPLAY (LIN, COL) " ENTER DISTRICT NUMBER (1 ..8): ".
	   ACCEPT J.
	   ADD I TO LIN.
	   DISPLAY (LIN, COL) " ENTER ZONE NUMBER (1 THRU 4) : ".
	   ACCEPT I.
	   PERFORM ADDDST2 VARYING K FROM 1 BY 1 UNTIL K > 12.
	   MOVE TOTAL TO TEMP1.
	   DISPLAY " ".
	   DISPLAY " SALES AMOUNT : ", TEMP1.
	   ACCEPT C.
	   GO TO MENU.
       ADDDST2.
	   ADD AMOUNT(I, J, K) TO TOTAL.





















